package com.syh.jn.scm.domain.downstream.repository.purchase;

import com.syh.core.ddd.infrastructure.repository.AggregateRepository;
import com.syh.jn.scm.domain.downstream.entity.purchase.DownPurchaseReturnOrder;
import com.syh.jn.scm.domain.downstream.entity.purchase.DownPurchaseReturnOrderItem;
import com.syh.jn.scm.dto.downstream.purchase.DownPurchaseReturnOrderItemVo;

import java.util.List;

/**
 * Date:2018/7/9
 * Author:Clown
 * Desc;
 */
public interface DownPurchaseReturnOrderRepository extends DownPurchaseReturnOrderReadRepository,AggregateRepository<DownPurchaseReturnOrder, Long> {
  /**
   * 修改订单主体状态
   * @param downPurchaseReturnOrder
   */
  public void updateStatus(DownPurchaseReturnOrder downPurchaseReturnOrder);

  /**
   * 根据id获取明细
   *
   * @param id
   * @return
   */
  List<DownPurchaseReturnOrderItem> getItemsByReturnOrderId(Long id);

  /**
   * 根据id查找明细(订单导出用)
   *
   * @param returnOrderIds
   * @return
   */
  public List<DownPurchaseReturnOrderItemVo> getItemsByPurchaseReturnOrderIds(Long[] returnOrderIds);

  /**
   * 取消订单
   *
   * @param purchaseReturnOrder
   */
  void cancel(DownPurchaseReturnOrder purchaseReturnOrder);

  /**
   * 上传订单图片
   * @param order
   */
  public void upload(DownPurchaseReturnOrder order);

  /**
   * 更新订单及订单项
   * @param order
   */
  public void updateOrderAndItems(DownPurchaseReturnOrder order);
}
